import { createRouter, createWebHistory,createWebHashHistory } from 'vue-router'
import { contentPath } from "@/constant/system.js"
// 全局静态路由
export const routes = [
  // 不在框架中页面处理
  {
    path: contentPath + "/layout",
    name: "全景",
    sort: 0,
    icon: "House",
    component: () => import("../views/layout/Layout.vue"),
    meta: { layout: "blank" },
    children: [
      {
        path: contentPath + "/",
        name: "首页",
        sort: 1,
        component: () => import("../views/system/home.vue"),
      },
      {
        path: contentPath + "/tradeManage",
        name: "练习管理",
        sort: 1,
        component: () => import("../views/oss/functionCenter/trade/index.vue"),
      },
      {
        path: contentPath + "/positionManage",
        name: "持仓管理",
        sort: 2,
        component: () =>
          import("../views/oss/functionCenter/position/index.vue"),
      },
      {
        path: contentPath + "/capitalManage",
        name: "资金管理",
        sort: 3,
        component: () =>
          import("../views/oss/functionCenter/capital/index.vue"),
      },
      {
        path: contentPath + "/advice",
        name: "投资建议",
        sort: 3,
        component: () => import("../views/oss/functionCenter/advice/index.vue"),
      },
    ],
  },
  {
    path: contentPath + "/home",
    name: "home",
    sort: 0,
    icon: "House",
    component: () => import("../views/layout/Layout.vue"),
  },
  {
    path: "/:pathMatch(.*)*",
    name: "404",
    component: () => import("../views/404.vue"),
  },
];

const router = createRouter({
  // createWebHistory(process.env.BASE_URL)
  mode: "history",
  base: contentPath,
  history: createWebHistory(),
  routes: routes,
});

export default router
